package com.nus.fellowmark.dao;

import com.nus.fellowmark.entity.SupervisionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * 
 * 
 * @author Chen Ruoyi
 * @email chenruoyisz@gmail.com
 * @date 2023-02-10  
 */
@Mapper
public interface SupervisionDao extends BaseMapper<SupervisionEntity> {
	/**
     * select modules supervised by staff_id
     * @param staffId
     * @return
     */
    @Select("SELECT * FROM supervision WHERE staff_id=#{staffId}")
    List<SupervisionEntity> selectByStaffId(Integer staffId);

    /**
     * select staff by module_id
     * @param moduleId
     * @return
     */
    @Select("SELECT * FROM supervision WHERE module_id=#{moduleId}")
    List<SupervisionEntity> selectByModuleId(Integer moduleId);

    /**
     * select by staff_id and module_id
     * @param staffId,moduleId
     * @return
     */
    @Select("SELECT * FROM supervision WHERE staff_id=#{staffId} AND module_id=#{moduleId}")
    SupervisionEntity selectByStaffIdAndModuleId(Integer staffId, Integer moduleId);
}
